package SmartQuestions;

import questionsObjects.Questions;

import java.util.LinkedList;
import java.util.Queue;

/**
 * Created with IntelliJ IDEA.
 * User: xpk
 * Date: 11/30/13
 * Time: 3:04 PM
 * To change this template use File | Settings | File Templates.
 */
class ThemesOfQuestion {
    private Queue<String> themesOfQuestions;
    private final Questions questions;

    public ThemesOfQuestion(Questions questions) {
        this.questions = questions;
        this.themesOfQuestions = new LinkedList<String>();

        for (int i = 0; i < this.questions.length(); i++) {
            if (!this.themesOfQuestions.contains(this.questions.getTheme(i))) {
                this.themesOfQuestions.offer(this.questions.getTheme(i));
            }
        }
    }

    public String getCurrentTheme() {
        return !themesOfQuestions.isEmpty() ? themesOfQuestions.poll() : "";
    }
}
